<template name="adminQueries">
    {{#if getConnection}}
        {{> pageHeading title=getPageHeading }}

        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>{{_ "admin"}}
                                <small>{{_ "admin_info"}}</small>
                            </h5>
                            <div class="ibox-tools">
                                <a id="btnSwitchView" href="#"
                                   title="{{_ "switch_result_view"}}">
                                    <i class="fa fa-exchange"></i>
                                </a>
                                <a id="aRunOnAdminDB" class="i-checks"
                                   style="display: none;"
                                   data-toggle="tooltip"
                                   title="{{_ "run_on_admin_info"}}">
                                    <input id="inputRunOnAdminDB" type="checkbox" value=""
                                           class="form-control"
                                           checked=""
                                           style="position: absolute; opacity: 0;"/>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label class="col-lg-1 control-label">{{_ "admin_query"}}</label>
                                    <div class="col-lg-11">
                                        <select id="cmbAdminQueries"
                                                data-placeholder="{{_ "choose_query"}}"
                                                class="chosen-select form-control"
                                                tabindex="-1">
                                            <option></option>
                                        </select>
                                        <span class="help-block m-b-none">{{{getHelpBlockForSelectedQuery}}}</span>
                                    </div>
                                </div>

                                {{> Template.dynamic template=getQueryTemplate}}

                                <div class="form-group">
                                    <div class="col-lg-12">
                                        <button id="btnExecuteAdminQuery"
                                                class="btn btn-block btn-outline btn-primary ladda-button"
                                                type="button"
                                                data-style="contract">
                                            <strong>{{_ "execute"}}</strong></button>
                                    </div>
                                </div>

                                <div id="divJsonEditor" class="form-group" style="display:none;">
                                    <div id="jsoneditor" style="width: 100%;height:500px" class="col-lg-12">

                                    </div>
                                </div>

                                <div id="divAceEditor" class="form-group" style="display: none">
                                    <div class="col-lg-12">
                                        <pre id='aceeditor' style="height: 500px"></pre>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    {{/if}}
</template>